import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import kit.Kit;

import java.io.*;

/**
 * Created by Administrator on 2017/10/19.
 */
public class hb {

    public static void main(String [] args) throws Exception{
        File dir = new File("e:/citys");
        File [] fs = dir.listFiles();
        JSONArray array = new JSONArray();
        for(File item : fs){
            String str = Kit.getFile(item.getAbsolutePath(),"utf-8");
            JSONObject json = (JSONObject)JSON.parse(str);
            array.add(json);
        }

        File file = new File("e:/citys/all.json");
        Writer w = new FileWriter(file);
        w.append(array.toJSONString());
        w.close();
    }

}
